package com.wuxu.huanfu

import android.Manifest
import android.app.Activity
import android.content.pm.PackageManager
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.core.view.LayoutInflaterCompat


/**
 *@author wuxu
 *@date 2024/5/16 18:34
 *@description 换肤测试页面
 */
class HFActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {

        val resMgr = ResourceMgr()
        resMgr.loadSkinAppResource(this, "/data/data/com.wuxu.huanfu/app-debug.apk")
        //关键步骤，设置Factory，用于view的创建。
        LayoutInflaterCompat.setFactory2(layoutInflater, WXFactory(this,resMgr))
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_huanfu)

//        resMgr.loadSkinAppResource(this, "/storage/emulated/0/data/app-debug.apk")



//        Log.i(WXFactory.TAG,"resource -> ${resMgr.mSkinPackageName}")
//        resMgr.mResource?.let {
//            Log.i(WXFactory.TAG,"www -> ${it.getIdentifier("skin_green","color",resMgr.mSkinPackageName)}")
//        }
    }
}